﻿@model IEnumerable<FCNS.ERP.Models.ErpRoom>

@{
    ViewBag.Title = "房间";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@ViewBag.Title</h2>

<p>
    <a class="newObjA" href="/House/RoomNew">新增</a>
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.CategoryHouse.Name)
        </th> 
        <th>
            @Html.DisplayNameFor(model => model.RoomStatus)
        </th> 
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Price)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Summary)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CategoryHouse.Name)
        </td> 
        <td>
            @Html.DisplayFor(modelItem => item.RoomStatus)
        </td> 
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Price )
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Summary)
        </td>
        <td>
            @Html.ActionLink("编辑", "RoomEdit", new { id = item.Id }) |
            @{ if (item.RoomStatus != FCNS.ERP.Models.ErpRoom.EnumRoomStatus.租赁)
        {
            <a href="RoomDelete/@item.Id" class="objDelete">删除 | </a> 
}
if (item.RoomStatus == FCNS.ERP.Models.ErpRoom.EnumRoomStatus.闲置)
{
        @Html.ActionLink("装修", "RoomStatus", new { id = item.Id, status = 1 })
}
if (item.RoomStatus == FCNS.ERP.Models.ErpRoom.EnumRoomStatus.装修)
{
        @Html.ActionLink("启用", "RoomStatus", new { id = item.Id, status = 0 })
}
            }
        </td>
    </tr>
}

</table>
